package org.cloud.automatic.queue.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.cloud.automatic.queue.entity.SystemSendQueueBO;
import org.cloud.automatic.queue.mapper.SystemSendQueueBOMapper;
import org.cloud.automatic.queue.service.SystemSendQueueBOService;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service("systemSendQueueBOService")
public class SystemSendQueueBOServiceImpl extends ServiceImpl<SystemSendQueueBOMapper, SystemSendQueueBO> implements SystemSendQueueBOService {

    /**
     * @Description: 独立事务更新队列表
     * @Param: [systemSendQueueBO]
     * @return: java.lang.Integer
     * @Author: gangzhenga
     * @Date: 2021/7/28 11:27
     */
    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public Integer indepUpdateSysSendQueueBO(SystemSendQueueBO systemSendQueueBO) {
        SystemSendQueueBOService queueBOService = (SystemSendQueueBOService) AopContext.currentProxy();
        return queueBOService.updateById(systemSendQueueBO) ? 1 : 0;
    }

    /**
     * @Description: 分页查询队列表
     * @Param: [page, systemSendQueueBO]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<org.springblade.common.queue.entity.SystemSendQueueBO>
     * @Author: gangzhenga
     * @Date: 2021/7/28 11:26
     */
	@Override
	public IPage<SystemSendQueueBO> queryPage(IPage<SystemSendQueueBO> page, SystemSendQueueBO systemSendQueueBO) {
		return baseMapper.queryPage(page, systemSendQueueBO);
	}
}
